#include <GL/glut.h>
#include "MegaMan.h"
#include "UtilFunctions.h"
#include "GlobalSettings.h"

void MegaMan::HandleInput()
{
	if (KeyDownSpecial[0])
		velocity.x = MSPEED;
	else if (KeyDownSpecial[1])
		velocity.x = -MSPEED;
	else
		velocity.x = 0;

	if (KeyDownSpecial[2])
		velocity.z = -MSPEED;
	else if (KeyDownSpecial[3])
		velocity.z = MSPEED;
	else
		velocity.z = 0;
}

void MegaMan::Update()
{
	// Play next animation frame from here.
	Move();

	IdleAnimation();
}

void MegaMan::Move()
{
	location += velocity;
}

void MegaMan::IdleAnimation()
{
	// Lets draw MegaManCube
	glPushMatrix();

	glTranslatef(location.x, location.y, location.z);
	glScalef(1, 2.5f, 1);
	glColor3f(0.0f, 0.0f, 1.0f);
	glutSolidCube(32.0f);

	glPopMatrix();
}